package cn.iocoder.yudao.module.yyzx.dal.mysql.meal_calendar;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.yyzx.controller.admin.meal_calendar.vo.FoodPageReqVO;
import cn.iocoder.yudao.module.yyzx.dal.dataobject.food.FoodDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 膳食信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface Meal_CalendarMapper extends BaseMapperX<FoodDO> {

    default PageResult<FoodDO> selectPage(FoodPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FoodDO>()
                .likeIfPresent(FoodDO::getFoodname, reqVO.getFoodname())
                .eqIfPresent(FoodDO::getFoodtype, reqVO.getFoodtype())
                .eqIfPresent(FoodDO::getIsMuslim, reqVO.getIsMuslim())
                .betweenIfPresent(FoodDO::getSupplyDate, reqVO.getSupplyDate())
                .eqIfPresent(FoodDO::getSupplyType, reqVO.getSupplyType())
                .betweenIfPresent(FoodDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FoodDO::getId));
    }

}